const db = require("../../../db/index");
const { SYSTEM_ERROR} = require("../../../utils/errorCode");
// 获取商品分类
exports.main = async (req, res) => {
    // 获取商品分类的 sql 语句
    const sql = `select * from categories`
    db.query(sql,(err, result) => {
        if (err) {
            console.log(err);
            return res.err(SYSTEM_ERROR);
        }

        return res.sd(result);
    })
}